<template>
  <edu-dialog :title="title" @open="onOpen" @close="onClose" ref="eduDialog" class="edu-message-box">
    <div class="text-center">
        <p>正在检查冲突</p>
        <div class="mb-8px">
            <el-progress :text-inside="true" :stroke-width="18" :percentage="percentage"></el-progress>
        </div>
    </div>
    <span slot="buttons">
      <el-button @click="close">{{$t('message.close')}}</el-button>
    </span>
  </edu-dialog>
</template>
<script>
import UTILS from "common/src/utils/utils";
/**
 * 对话框组件
 */
export default {
  name: "EduCheckConfigDialog",
  props: {
    title: {
      type: String,
      default: "提示"
    },
    data: {
      type: Object,
      default: null
    }
  },
  data() {
    return {};
  },
  computed: {
    percentage() {
      if (
        !_.isNil(this.data) &&
        !_.isNil(this.data.total) &&
        !_.isNil(this.data.doneCount)
      ) {
        return _.round((this.data.doneCount / this.data.total) * 100, 2);
      }
      return 0;
    }
  },
  mounted() {},
  created() {},
  methods: {
    open() {
      this.$refs.eduDialog.open();
    },
    onOpen() {
      setTimeout(() => {
        this.$emit("open");
      }, 300);
    },
    close() {
      this.$refs.eduDialog.close();
    },
    onClose() {
      this.$emit("close");
    }
  }
};
</script>

<style lang="scss">
</style>
